3.151 \(\int (c+d x)^3 (a+b \sin (e+f x)) \, dx\)

Optimal. Leaf size=90 \[ \frac{a (c+d x)^4}{4 d}+\frac{6 b d^2 (c+d x) \cos (e+f x)}{f^3}+\frac{3 b d (c+d x)^2 \sin (e+f x)}{f^2}-\frac{b (c+d x)^3 \cos (e+f x)}{f}-\frac{6 b d^3 \sin (e+f x)}{f^4} \]

[Out]

(a*(c + d*x)^4)/(4*d) + (6*b*d^2*(c + d*x)*Cos[e + f*x])/f^3 - (b*(c + d*x)^3*Cos[e + f*x])/f - (6*b*d^3*Sin[e
 + f*x])/f^4 + (3*b*d*(c + d*x)^2*Sin[e + f*x])/f^2

________________________________________________________________________________________

Rubi [A]  time = 0.122539, antiderivative size = 90, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3317, 3296, 2637} \[ \frac{a (c+d x)^4}{4 d}+\frac{6 b d^2 (c+d x) \cos (e+f x)}{f^3}+\frac{3 b d (c+d x)^2 \sin (e+f x)}{f^2}-\frac{b (c+d x)^3 \cos (e+f x)}{f}-\frac{6 b d^3 \sin (e+f x)}{f^4} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^3*(a + b*Sin[e + f*x]),x]

[Out]

(a*(c + d*x)^4)/(4*d) + (6*b*d^2*(c + d*x)*Cos[e + f*x])/f^3 - (b*(c + d*x)^3*Cos[e + f*x])/f - (6*b*d^3*Sin[e
 + f*x])/f^4 + (3*b*d*(c + d*x)^2*Sin[e + f*x])/f^2

Rule 3317

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] ||
IGtQ[m, 0] || NeQ[a^2 - b^2, 0])

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (c+d x)^3 (a+b \sin (e+f x)) \, dx &=\int \left (a (c+d x)^3+b (c+d x)^3 \sin (e+f x)\right ) \, dx\\ &=\frac{a (c+d x)^4}{4 d}+b \int (c+d x)^3 \sin (e+f x) \, dx\\ &=\frac{a (c+d x)^4}{4 d}-\frac{b (c+d x)^3 \cos (e+f x)}{f}+\frac{(3 b d) \int (c+d x)^2 \cos (e+f x) \, dx}{f}\\ &=\frac{a (c+d x)^4}{4 d}-\frac{b (c+d x)^3 \cos (e+f x)}{f}+\frac{3 b d (c+d x)^2 \sin (e+f x)}{f^2}-\frac{\left (6 b d^2\right ) \int (c+d x) \sin (e+f x) \, dx}{f^2}\\ &=\frac{a (c+d x)^4}{4 d}+\frac{6 b d^2 (c+d x) \cos (e+f x)}{f^3}-\frac{b (c+d x)^3 \cos (e+f x)}{f}+\frac{3 b d (c+d x)^2 \sin (e+f x)}{f^2}-\frac{\left (6 b d^3\right ) \int \cos (e+f x) \, dx}{f^3}\\ &=\frac{a (c+d x)^4}{4 d}+\frac{6 b d^2 (c+d x) \cos (e+f x)}{f^3}-\frac{b (c+d x)^3 \cos (e+f x)}{f}-\frac{6 b d^3 \sin (e+f x)}{f^4}+\frac{3 b d (c+d x)^2 \sin (e+f x)}{f^2}\\ \end{align*}

Mathematica [A]  time = 0.432017, size = 124, normalized size = 1.38 \[ \frac{1}{4} a x \left (6 c^2 d x+4 c^3+4 c d^2 x^2+d^3 x^3\right )+\frac{3 b d \left (c^2 f^2+2 c d f^2 x+d^2 \left (f^2 x^2-2\right )\right ) \sin (e+f x)}{f^4}-\frac{b (c+d x) \left (c^2 f^2+2 c d f^2 x+d^2 \left (f^2 x^2-6\right )\right ) \cos (e+f x)}{f^3} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^3*(a + b*Sin[e + f*x]),x]

[Out]

(a*x*(4*c^3 + 6*c^2*d*x + 4*c*d^2*x^2 + d^3*x^3))/4 - (b*(c + d*x)*(c^2*f^2 + 2*c*d*f^2*x + d^2*(-6 + f^2*x^2)
)*Cos[e + f*x])/f^3 + (3*b*d*(c^2*f^2 + 2*c*d*f^2*x + d^2*(-2 + f^2*x^2))*Sin[e + f*x])/f^4

________________________________________________________________________________________

Maple [B]  time = 0.011, size = 482, normalized size = 5.4 \begin{align*}{\frac{1}{f} \left ({\frac{a{d}^{3} \left ( fx+e \right ) ^{4}}{4\,{f}^{3}}}+{\frac{ac{d}^{2} \left ( fx+e \right ) ^{3}}{{f}^{2}}}-{\frac{a{d}^{3}e \left ( fx+e \right ) ^{3}}{{f}^{3}}}+{\frac{3\,a{c}^{2}d \left ( fx+e \right ) ^{2}}{2\,f}}-3\,{\frac{ac{d}^{2}e \left ( fx+e \right ) ^{2}}{{f}^{2}}}+{\frac{3\,a{d}^{3}{e}^{2} \left ( fx+e \right ) ^{2}}{2\,{f}^{3}}}+a{c}^{3} \left ( fx+e \right ) -3\,{\frac{a{c}^{2}de \left ( fx+e \right ) }{f}}+3\,{\frac{ac{d}^{2}{e}^{2} \left ( fx+e \right ) }{{f}^{2}}}-{\frac{a{d}^{3}{e}^{3} \left ( fx+e \right ) }{{f}^{3}}}+{\frac{b{d}^{3} \left ( - \left ( fx+e \right ) ^{3}\cos \left ( fx+e \right ) +3\, \left ( fx+e \right ) ^{2}\sin \left ( fx+e \right ) -6\,\sin \left ( fx+e \right ) +6\, \left ( fx+e \right ) \cos \left ( fx+e \right ) \right ) }{{f}^{3}}}+3\,{\frac{cb{d}^{2} \left ( - \left ( fx+e \right ) ^{2}\cos \left ( fx+e \right ) +2\,\cos \left ( fx+e \right ) +2\, \left ( fx+e \right ) \sin \left ( fx+e \right ) \right ) }{{f}^{2}}}-3\,{\frac{b{d}^{3}e \left ( - \left ( fx+e \right ) ^{2}\cos \left ( fx+e \right ) +2\,\cos \left ( fx+e \right ) +2\, \left ( fx+e \right ) \sin \left ( fx+e \right ) \right ) }{{f}^{3}}}+3\,{\frac{{c}^{2}bd \left ( \sin \left ( fx+e \right ) - \left ( fx+e \right ) \cos \left ( fx+e \right ) \right ) }{f}}-6\,{\frac{cb{d}^{2}e \left ( \sin \left ( fx+e \right ) - \left ( fx+e \right ) \cos \left ( fx+e \right ) \right ) }{{f}^{2}}}+3\,{\frac{b{d}^{3}{e}^{2} \left ( \sin \left ( fx+e \right ) - \left ( fx+e \right ) \cos \left ( fx+e \right ) \right ) }{{f}^{3}}}-{c}^{3}b\cos \left ( fx+e \right ) +3\,{\frac{{c}^{2}bde\cos \left ( fx+e \right ) }{f}}-3\,{\frac{cb{d}^{2}{e}^{2}\cos \left ( fx+e \right ) }{{f}^{2}}}+{\frac{b{d}^{3}{e}^{3}\cos \left ( fx+e \right ) }{{f}^{3}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^3*(a+b*sin(f*x+e)),x)

[Out]

1/f*(1/4*a/f^3*d^3*(f*x+e)^4+a/f^2*c*d^2*(f*x+e)^3-a/f^3*d^3*e*(f*x+e)^3+3/2*a/f*c^2*d*(f*x+e)^2-3*a/f^2*c*d^2
*e*(f*x+e)^2+3/2*a/f^3*d^3*e^2*(f*x+e)^2+a*c^3*(f*x+e)-3*a/f*c^2*d*e*(f*x+e)+3*a/f^2*c*d^2*e^2*(f*x+e)-a/f^3*d
^3*e^3*(f*x+e)+1/f^3*b*d^3*(-(f*x+e)^3*cos(f*x+e)+3*(f*x+e)^2*sin(f*x+e)-6*sin(f*x+e)+6*(f*x+e)*cos(f*x+e))+3/
f^2*b*c*d^2*(-(f*x+e)^2*cos(f*x+e)+2*cos(f*x+e)+2*(f*x+e)*sin(f*x+e))-3/f^3*b*d^3*e*(-(f*x+e)^2*cos(f*x+e)+2*c
os(f*x+e)+2*(f*x+e)*sin(f*x+e))+3/f*b*c^2*d*(sin(f*x+e)-(f*x+e)*cos(f*x+e))-6/f^2*b*c*d^2*e*(sin(f*x+e)-(f*x+e
)*cos(f*x+e))+3/f^3*b*d^3*e^2*(sin(f*x+e)-(f*x+e)*cos(f*x+e))-c^3*b*cos(f*x+e)+3/f*b*c^2*d*e*cos(f*x+e)-3/f^2*
b*c*d^2*e^2*cos(f*x+e)+1/f^3*b*d^3*e^3*cos(f*x+e))

________________________________________________________________________________________

Maxima [B]  time = 1.05, size = 624, normalized size = 6.93 \begin{align*} \frac{4 \,{\left (f x + e\right )} a c^{3} + \frac{{\left (f x + e\right )}^{4} a d^{3}}{f^{3}} - \frac{4 \,{\left (f x + e\right )}^{3} a d^{3} e}{f^{3}} + \frac{6 \,{\left (f x + e\right )}^{2} a d^{3} e^{2}}{f^{3}} - \frac{4 \,{\left (f x + e\right )} a d^{3} e^{3}}{f^{3}} + \frac{4 \,{\left (f x + e\right )}^{3} a c d^{2}}{f^{2}} - \frac{12 \,{\left (f x + e\right )}^{2} a c d^{2} e}{f^{2}} + \frac{12 \,{\left (f x + e\right )} a c d^{2} e^{2}}{f^{2}} + \frac{6 \,{\left (f x + e\right )}^{2} a c^{2} d}{f} - \frac{12 \,{\left (f x + e\right )} a c^{2} d e}{f} - 4 \, b c^{3} \cos \left (f x + e\right ) + \frac{4 \, b d^{3} e^{3} \cos \left (f x + e\right )}{f^{3}} - \frac{12 \, b c d^{2} e^{2} \cos \left (f x + e\right )}{f^{2}} + \frac{12 \, b c^{2} d e \cos \left (f x + e\right )}{f} - \frac{12 \,{\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} b d^{3} e^{2}}{f^{3}} + \frac{24 \,{\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} b c d^{2} e}{f^{2}} - \frac{12 \,{\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} b c^{2} d}{f} + \frac{12 \,{\left ({\left ({\left (f x + e\right )}^{2} - 2\right )} \cos \left (f x + e\right ) - 2 \,{\left (f x + e\right )} \sin \left (f x + e\right )\right )} b d^{3} e}{f^{3}} - \frac{12 \,{\left ({\left ({\left (f x + e\right )}^{2} - 2\right )} \cos \left (f x + e\right ) - 2 \,{\left (f x + e\right )} \sin \left (f x + e\right )\right )} b c d^{2}}{f^{2}} - \frac{4 \,{\left ({\left ({\left (f x + e\right )}^{3} - 6 \, f x - 6 \, e\right )} \cos \left (f x + e\right ) - 3 \,{\left ({\left (f x + e\right )}^{2} - 2\right )} \sin \left (f x + e\right )\right )} b d^{3}}{f^{3}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3*(a+b*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/4*(4*(f*x + e)*a*c^3 + (f*x + e)^4*a*d^3/f^3 - 4*(f*x + e)^3*a*d^3*e/f^3 + 6*(f*x + e)^2*a*d^3*e^2/f^3 - 4*(
f*x + e)*a*d^3*e^3/f^3 + 4*(f*x + e)^3*a*c*d^2/f^2 - 12*(f*x + e)^2*a*c*d^2*e/f^2 + 12*(f*x + e)*a*c*d^2*e^2/f
^2 + 6*(f*x + e)^2*a*c^2*d/f - 12*(f*x + e)*a*c^2*d*e/f - 4*b*c^3*cos(f*x + e) + 4*b*d^3*e^3*cos(f*x + e)/f^3
- 12*b*c*d^2*e^2*cos(f*x + e)/f^2 + 12*b*c^2*d*e*cos(f*x + e)/f - 12*((f*x + e)*cos(f*x + e) - sin(f*x + e))*b
*d^3*e^2/f^3 + 24*((f*x + e)*cos(f*x + e) - sin(f*x + e))*b*c*d^2*e/f^2 - 12*((f*x + e)*cos(f*x + e) - sin(f*x
 + e))*b*c^2*d/f + 12*(((f*x + e)^2 - 2)*cos(f*x + e) - 2*(f*x + e)*sin(f*x + e))*b*d^3*e/f^3 - 12*(((f*x + e)
^2 - 2)*cos(f*x + e) - 2*(f*x + e)*sin(f*x + e))*b*c*d^2/f^2 - 4*(((f*x + e)^3 - 6*f*x - 6*e)*cos(f*x + e) - 3
*((f*x + e)^2 - 2)*sin(f*x + e))*b*d^3/f^3)/f

________________________________________________________________________________________

Fricas [A]  time = 1.69688, size = 362, normalized size = 4.02 \begin{align*} \frac{a d^{3} f^{4} x^{4} + 4 \, a c d^{2} f^{4} x^{3} + 6 \, a c^{2} d f^{4} x^{2} + 4 \, a c^{3} f^{4} x - 4 \,{\left (b d^{3} f^{3} x^{3} + 3 \, b c d^{2} f^{3} x^{2} + b c^{3} f^{3} - 6 \, b c d^{2} f + 3 \,{\left (b c^{2} d f^{3} - 2 \, b d^{3} f\right )} x\right )} \cos \left (f x + e\right ) + 12 \,{\left (b d^{3} f^{2} x^{2} + 2 \, b c d^{2} f^{2} x + b c^{2} d f^{2} - 2 \, b d^{3}\right )} \sin \left (f x + e\right )}{4 \, f^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3*(a+b*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/4*(a*d^3*f^4*x^4 + 4*a*c*d^2*f^4*x^3 + 6*a*c^2*d*f^4*x^2 + 4*a*c^3*f^4*x - 4*(b*d^3*f^3*x^3 + 3*b*c*d^2*f^3*
x^2 + b*c^3*f^3 - 6*b*c*d^2*f + 3*(b*c^2*d*f^3 - 2*b*d^3*f)*x)*cos(f*x + e) + 12*(b*d^3*f^2*x^2 + 2*b*c*d^2*f^
2*x + b*c^2*d*f^2 - 2*b*d^3)*sin(f*x + e))/f^4

________________________________________________________________________________________

Sympy [A]  time = 1.75372, size = 264, normalized size = 2.93 \begin{align*} \begin{cases} a c^{3} x + \frac{3 a c^{2} d x^{2}}{2} + a c d^{2} x^{3} + \frac{a d^{3} x^{4}}{4} - \frac{b c^{3} \cos{\left (e + f x \right )}}{f} - \frac{3 b c^{2} d x \cos{\left (e + f x \right )}}{f} + \frac{3 b c^{2} d \sin{\left (e + f x \right )}}{f^{2}} - \frac{3 b c d^{2} x^{2} \cos{\left (e + f x \right )}}{f} + \frac{6 b c d^{2} x \sin{\left (e + f x \right )}}{f^{2}} + \frac{6 b c d^{2} \cos{\left (e + f x \right )}}{f^{3}} - \frac{b d^{3} x^{3} \cos{\left (e + f x \right )}}{f} + \frac{3 b d^{3} x^{2} \sin{\left (e + f x \right )}}{f^{2}} + \frac{6 b d^{3} x \cos{\left (e + f x \right )}}{f^{3}} - \frac{6 b d^{3} \sin{\left (e + f x \right )}}{f^{4}} & \text{for}\: f \neq 0 \\\left (a + b \sin{\left (e \right )}\right ) \left (c^{3} x + \frac{3 c^{2} d x^{2}}{2} + c d^{2} x^{3} + \frac{d^{3} x^{4}}{4}\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**3*(a+b*sin(f*x+e)),x)

[Out]

Piecewise((a*c**3*x + 3*a*c**2*d*x**2/2 + a*c*d**2*x**3 + a*d**3*x**4/4 - b*c**3*cos(e + f*x)/f - 3*b*c**2*d*x
*cos(e + f*x)/f + 3*b*c**2*d*sin(e + f*x)/f**2 - 3*b*c*d**2*x**2*cos(e + f*x)/f + 6*b*c*d**2*x*sin(e + f*x)/f*
*2 + 6*b*c*d**2*cos(e + f*x)/f**3 - b*d**3*x**3*cos(e + f*x)/f + 3*b*d**3*x**2*sin(e + f*x)/f**2 + 6*b*d**3*x*
cos(e + f*x)/f**3 - 6*b*d**3*sin(e + f*x)/f**4, Ne(f, 0)), ((a + b*sin(e))*(c**3*x + 3*c**2*d*x**2/2 + c*d**2*
x**3 + d**3*x**4/4), True))

________________________________________________________________________________________

Giac [A]  time = 1.46284, size = 212, normalized size = 2.36 \begin{align*} \frac{1}{4} \, a d^{3} x^{4} + a c d^{2} x^{3} + \frac{3}{2} \, a c^{2} d x^{2} + a c^{3} x - \frac{{\left (b d^{3} f^{3} x^{3} + 3 \, b c d^{2} f^{3} x^{2} + 3 \, b c^{2} d f^{3} x + b c^{3} f^{3} - 6 \, b d^{3} f x - 6 \, b c d^{2} f\right )} \cos \left (f x + e\right )}{f^{4}} + \frac{3 \,{\left (b d^{3} f^{2} x^{2} + 2 \, b c d^{2} f^{2} x + b c^{2} d f^{2} - 2 \, b d^{3}\right )} \sin \left (f x + e\right )}{f^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3*(a+b*sin(f*x+e)),x, algorithm="giac")

[Out]

1/4*a*d^3*x^4 + a*c*d^2*x^3 + 3/2*a*c^2*d*x^2 + a*c^3*x - (b*d^3*f^3*x^3 + 3*b*c*d^2*f^3*x^2 + 3*b*c^2*d*f^3*x
 + b*c^3*f^3 - 6*b*d^3*f*x - 6*b*c*d^2*f)*cos(f*x + e)/f^4 + 3*(b*d^3*f^2*x^2 + 2*b*c*d^2*f^2*x + b*c^2*d*f^2
- 2*b*d^3)*sin(f*x + e)/f^4